***Master do file***

clear

**Set path to Replication Package**
cd "XXX\Replication Package"

**Figure 1 + Figure A1a**

do "Results\fig_1\Cloud plot full population"

**Figure 2 + Figure B4**

*Create results*

do "Results\fig_2\Create results"

*Create plots*

do "Results\fig_2\Robust sorting results"

**Figure 3 + Tabel 1**

*Create results*

do "Results\fig_3\Decompositions"

*Create plot*

do "Results\fig_3\Outputs"

**Table A1 + Table A2**

do "Results\tab_A1\Cross tables with full pop fields"

**Figure A1 + Figure A2 (b+c+d)**

*Create results*

do "Results\fig_A1\LFS_clustering_prep_BF_dropmissing"

do "Results\fig_A1\Dataset with singles"

do "Results\fig_A1\Dataset with singles primeage"

*Create plots*

do "Results\fig_A1\Cloud_new_primeage"

**Figure A2 (e+f)**

*Create results*

do "Results\fig_A2\Get life-time earnings updated"

do "Results\fig_A2\Get types 1990 2010 updated"

*Create plots*

do "Results\fig_A2\Cloud plot with life earnings draft 50plus"

**Table A3**

*OBS: Run the code for Figure A1 first

*Create results*

do "Results\tab_A3\Get full sample"

do "Results\tab_A3\Get life-time earnings"

*Run regressions*

do "Results\tab_A3\Run regressions final"

**Figure B1 + Figure B2 + Figure B5**

*Create results*

do "Results\fig_B1\Create results"

*Create plots*

do "Results\fig_B1\Create figures"


**Figure B3**

*OBS: Run the code for Figure B1 first

*Create plots*

do "Results\fig_B3\Single shares"

**Table B1**

*OBS: Run the code for Figure B1 first
*OBS: Run the code for Figure 3 first
*OBS: Run the code for Figure A1 first

*Create results*

*Scenario 1*

do "Results\tab_B1\Scenario_1\Sorting\Create results for fig 3 primeage long"

do "Results\tab_B1\Scenario_1\Decomposition\Decompositions_eq_fig_4_primeage_long"

*Scenario 2*

do "Results\tab_B1\Scenario_2\Sorting\Create results for fig 3 primeage long baseline"

do "Results\tab_B1\Scenario_2\Decomposition\Decompositions_eq_fig_4_primeage_long_baseline"

*Scenario 3*

do "Results\tab_B1\Scenario_3\Get life-time earnings"

do "Results\tab_B1\Scenario_3\Get types 1990 2010"

do "Results\tab_B1\Scenario_3\Sorting\Create results lifetime 1990 2010"

do "Results\tab_B1\Scenario_3\Decomposition\Decompositions lifetime 1990 2010_eq"

*Scenario 4*

do "Results\tab_B1\Scenario_4\Sorting\Create results ambition 1990 2010"

do "Results\tab_B1\Scenario_4\Decomposition\Decompositions ambition 1990 2010_eq"

*Scenario 5*

do "Results\tab_B1\Scenario_5\Sorting\Create results ambition 1990 2010"

do "Results\tab_B1\Scenario_5\Decomposition\Decompositions ambition 1990 2010_eq"

*Collect results*

do "Results\tab_B1\Collect results_eq_appendix"

do "Results\tab_B1\Table 5 lifetime addon_eq"

**Table B2**

*Create results*
do "Results\tab_B2\Decompositions"

**Table B3**

*OBS: Run the code for Figure B1 first
*OBS: Run the code for Figure 3 first

*Create results*

*Scenario 1*

do "Results\tab_B3\Scenario_1\Dataset with singles"

do "Results\tab_B3\Scenario_1\Sorting\Create results"

do "Results\tab_B3\Scenario_1\Decomposition\Decompositions_eq"

*Scenario 2*

do "Results\tab_B3\Scenario_2\Men - sample 1"

do "Results\tab_B3\Scenario_2\Men - sample 2"

do "Results\tab_B3\Scenario_2\Women - sample 1"

do "Results\tab_B3\Scenario_2\Women - sample 2"

do "Results\tab_B3\Scenario_2\Joining couples"

do "Results\tab_B3\Scenario_2\Sorting\Create results"

do "Results\tab_B3\Scenario_2\Decomposition\Decompositions_eq"

*Scenario 3*

do "Results\tab_B3\Scenario_3\First decade - sample 1"

do "Results\tab_B3\Scenario_3\First decade - sample 2"

do "Results\tab_B3\Scenario_3\Second decade - sample 1"

do "Results\tab_B3\Scenario_3\Second decade - sample 2"

do "Results\tab_B3\Scenario_3\Third decade - sample 1"

do "Results\tab_B3\Scenario_3\Third decade - sample 2"

do "Results\tab_B3\Scenario_3\Joining decades"

do "Results\tab_B3\Scenario_3\Sorting\Create results"

do "Results\tab_B3\Scenario_3\Decomposition\Decompositions_eq"

*Scenario 4*

do "Results\tab_B3\Scenario_4\Sorting\Create results"

do "Results\tab_B3\Scenario_4\Decomposition\Decompositions_eq"

*Scenario 5*

do "Results\tab_B3\Scenario_5\Create_3_and_5_types"

do "Results\tab_B3\Scenario_5\Sorting\Create results"

do "Results\tab_B3\Scenario_5\Decomposition\Decompositions_eq"

*Scenario 6*

do "Results\tab_B3\Scenario_6\Sorting\Create results"

do "Results\tab_B3\Scenario_6\Decomposition\Decompositions_eq"

*Scenario 7*

do "Results\tab_B3\Scenario_7\Dataset with singles"

do "Results\tab_B3\Scenario_7\Sorting\Create results"

do "Results\tab_B3\Scenario_7\Decomposition\Decompositions_eq"

*Scenario 8*

do "Results\tab_B3\Scenario_8\Dataset with singles"

do "Results\tab_B3\Scenario_8\Sorting\Create results"

do "Results\tab_B3\Scenario_8\Decomposition\Decompositions_eq"

*Scenario 9*

do "Results\tab_B3\Scenario_9\Create types"

do "Results\tab_B3\Scenario_9\Sorting\Create results"

do "Results\tab_B3\Scenario_9\Decomposition\Decompositions_eq"

*Scenario 10*

do "Results\tab_B3\Scenario_10\Dataset with singles"

do "Results\tab_B3\Scenario_10\Sorting\Create results"

do "Results\tab_B3\Scenario_10\Decomposition\Decompositions_eq"

*Scenario 11*

do "Results\tab_B3\Scenario_11\Sorting\Create results"

do "Results\tab_B3\Scenario_11\Decomposition\Decompositions_eq"

*Scenario 12*

do "Results\tab_B3\Scenario_12\Dataset with singles"

do "Results\tab_B3\Scenario_12\Sorting\Create results"

do "Results\tab_B3\Scenario_12\Decomposition\Decompositions_eq"

*Scenario 13*

do "Results\tab_B3\Scenario_13\Programs in low low cluster"

do "Results\tab_B3\Scenario_13\Sorting\Create results"

do "Results\tab_B3\Scenario_13\Decomposition\Decompositions_eq"

*Scenario 14*

do "Results\tab_B3\Scenario_14\Dataset with singles"

do "Results\tab_B3\Scenario_14\Sorting\Create results"

do "Results\tab_B3\Scenario_14\Decomposition\Decompositions_eq"


*Collect results*

do "Results\tab_B3\Collect robustness_eq"

do "Results\tab_B3\Table 5_eq"

do "Results\tab_B3\Collect robustness_eq_2"

do "Results\tab_B3\Collect robustness_eq_3"

do "Results\tab_B3\Collect results"


**Figure B6**

*OBS: Run the code for Table B3 first

*Create plots*
do "Results\fig_B6\Cloud plot"

**Figure B7**

*OBS: Run the code for Table B3 first

*Create plots*

do "Results\fig_B7\Cloud plot"

**Figure B8**

*Create plot*

do "Results\fig_B8\Cloud plot full population by institution"








